From: Daniel van Vugt Date: Thu, 10 May 2018 10:13:49 +0000 (+0800) Subject: magnifier.js: Fix zoom juddering X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~929^2~5^2~62 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=94101e8bb88e86e8ae9f07ae4e0e4fc568441a2d;p=gnome-shell.git magnifier.js: Fix zoom juddering Make Zoom respond to the mouse silky-smoothly. It was previously hard-coded to: 1000/50 = 20 FPS. https://bugzilla.gnome.org/show_bug.cgi?id=682013 https://launchpad.net/bugs/1691675 --- diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js index b752b127a..3103630ca 100644 --- a/js/ui/magnifier.js +++ b/js/ui/magnifier.js @@ -19,7 +19,6 @@ const MagnifierDBus = imports.ui.magnifierDBus; const Params = imports.misc.params; const PointerWatcher = imports.ui.pointerWatcher; -var MOUSE_POLL_FREQUENCY = 50; var CROSSHAIRS_CLIP_SIZE = [100, 100]; var NO_CHANGE = 0.0; @@ -152,8 +151,10 @@ var Magnifier = new Lang.Class({ * Turn on mouse tracking, if not already doing so. */ startTrackingMouse() { - if (!this._pointerWatch) - this._pointerWatch = PointerWatcher.getPointerWatcher().addWatch(MOUSE_POLL_FREQUENCY, this.scrollToMousePos.bind(this)); + if (!this._pointerWatch) { + let interval = 1000 / Clutter.get_default_frame_rate(); + this._pointerWatch = PointerWatcher.getPointerWatcher().addWatch(interval, this.scrollToMousePos.bind(this)); + } }, /**